function GetSubnet() {

	var myData = [
			['1', '研发组子网', "研发组使用", "192.168.0.1", '255.255.255.0'],
			['2', '研发组子网', "研发组使用", "192.168.0.1", '255.255.255.0'],
			['3', '研发组子网', "研发组使用", "192.168.0.1", '255.255.255.0'],
			['4', '研发组子网', "研发组使用", "192.168.0.1", '255.255.255.0'],
			['5', '研发组子网', "研发组使用", "192.168.0.1", '255.255.255.0']

	];


	var store = new Ext.data.ArrayStore({
				fields : [{
							name : 'id'
						}, {
							name : 'name'
						}, {
							name : 'depict'
						}, {
							name : 'start_ip'
						}, {
							name : 'end_ip'
						}]
			});
			
	store.loadData(myData);
	
	var sm = new Ext.grid.CheckboxSelectionModel();
	var grid = new Ext.grid.GridPanel({
				store : store,
				columns : [sm, {
							id : 'id',
							header : 'id',
							width : 10,
							sortable : true,
							dataIndex : 'id',
							hidden : true
						}, {
							header : '网段名称',
							width : 150,
							sortable : true,
							dataIndex : 'name'
						}, {
							header : '描述',
							width : 70,
							sortable : true,
							dataIndex : 'depict'
						}, {
							header : 'IP',
							width : 70,
							sortable : true,
							dataIndex : 'start_ip'
						}, {
							header : '掩码',
							width : 150,
							sortable : true,
							dataIndex : 'end_ip'
						}],
				sm : sm,
				tbar : [{
				            text:'添加',
				            tooltip : '添加',
				            iconCls: 'add', 
							handler : function() {
								SubnetWindows(subnetReturn);
							}
				        },'-',{
							text : '编辑',
							tooltip : '编辑',
							iconCls : 'modify',
							handler : function() {
								SubnetWindows(subnetReturn);
							}
						}, '-', {
							text : '删除',
							tooltip : '删除',
							iconCls : 'delete',
							ref : '../removeBtn',
							disabled : true,
							handler : function() {
								var s = grid.getSelectionModel().getSelections();
								for (var i = 0; r = s[i]; i++) {
									store.remove(r);
								}
							}
						}, '-', {
							text : '刷新',
							tooltip : '刷新',
							iconCls : 'refresh',
							handler : function() {							
								store.loadData(myData);
							}
						}],
				
				stripeRows : true,
				autoExpandColumn : 'id',
				stateful : true,
				stateId : 'grid'
			});
	grid.getSelectionModel().on('selectionchange', function(sm) {
				grid.removeBtn.setDisabled(sm.getCount() < 1);
			});

	function subnetReturn(data){
		var jsondata = Ext.util.JSON.decode(data);
		
	}

	function reflashgriad(page) {
	}
	
	
	
	return grid;
}


function SubnetWindows(subnetReturn){


	var subnet_center = {
		xtype: 'fieldset',
		margins:'5 5 5 5',
		layout : 'form',
		region:'center',
		bodyStyle : 'padding:10px;',
		items: [
		{
			xtype: 'textfield',
			name: 'name',
			id  : 'name',
			fieldLabel: '子网名称',
			anchor: '100%'
		},{
			xtype: 'textfield',
			name: 'depict',
			id  : 'depict',
			fieldLabel: '描述',
			anchor: '100%'
		},{
			xtype: 'textfield',
			name: 'start_ip',
			id  : 'start_ip',
			fieldLabel: 'IP',
			anchor: '100%'
		},{
			xtype: 'textfield',
			name: 'end_ip',
			id  : 'end_ip',
			fieldLabel: '掩码',
			anchor: '100%'
		},new Ext.form.CompositeField({ 
							    fieldLabel: '关联网段', 
							    items: [ 
							    		
							        new Ext.form.TextField({ 
										    name: 'my_field',
										    value:'',
										    flex: 1 
										  }),{ 
													xtype:"button", 
													text:"...", 
													handler:function() 
													{ 
															GetLinkSubnet();
													}
											}
							         
							    ] 
						})
	
		]
	};

	var subnetWindows = new Ext.Window({
				layout : 'border',
				width : 400,
				height : 250,
				title : "添加网段",
				modal : true,
				resizable : true,
				maximizable : true,
				iconCls : 'subnet',
				items : [subnet_center],
				plain : true
				
			});
	subnetWindows.addButton({
				text : "确定",
				handler : function() {
					var data = "{name:'" + Ext.get("name").getValue() + "',depict:'" + Ext.get("depict").getValue() + "',start_ip:'" + Ext.get("start_ip").getValue() + "',end_ip:'" + Ext.get("end_ip").getValue() + "'}";
					subnetReturn(data);
					subnetWindows.close();
				}
			});
	subnetWindows.addButton({
				text : '取 消',
				handler : function() {
					subnetWindows.close();
				}
			});
	subnetWindows.show();

}
	function GetLinkSubnet(){

	var myData = [
			['1', '研发组子网', "研发组使用", "192.168.0.1", '255.255.255.0'],
			['2', '研发组子网', "研发组使用", "192.168.0.1", '255.255.255.0'],
			['3', '研发组子网', "研发组使用", "192.168.0.1", '255.255.255.0'],
			['4', '研发组子网', "研发组使用", "192.168.0.1", '255.255.255.0'],
			['5', '研发组子网', "研发组使用", "192.168.0.1", '255.255.255.0']

	];


	var store = new Ext.data.ArrayStore({
				fields : [{
							name : 'id'
						}, {
							name : 'name'
						}, {
							name : 'depict'
						}, {
							name : 'start_ip'
						}, {
							name : 'end_ip'
						}]
			});
			
	store.loadData(myData);
	var sm = new Ext.grid.CheckboxSelectionModel();
	var grid = new Ext.grid.GridPanel({
				store : store,
				columns : [sm, {
							id : 'id',
							header : 'id',
							width : 10,
							sortable : true,
							dataIndex : 'id',
							hidden : true
						}, {
							header : '网段名称',
							width : 150,
							sortable : true,
							dataIndex : 'name'
						}, {
							header : '描述',
							width : 70,
							sortable : true,
							dataIndex : 'depict'
						}, {
							header : 'IP',
							width : 70,
							sortable : true,
							dataIndex : 'start_ip'
						}, {
							header : '掩码',
							width : 150,
							sortable : true,
							dataIndex : 'end_ip'
						}],
				sm : sm,
				tbar : [
						'Filter:',{
								xtype : 'textfield',
								id : 'srcip1',
								name : 'srcip1',
								width : 300
						},
						{
							text : 'Filter',
							tooltip : 'Filter',
							handler : function() {							
							}
						},{
							text : 'Clear',
							tooltip : 'Clear',
							handler : function() {							
							}
						}],
				stripeRows : true,
				autoExpandColumn : 'id',
				stateful : true,
				stateId : 'linkdevicegrid',
				region : 'center'
			});



	var WeekTimeWindows = new Ext.Window({
				layout : 'border',
				width : 600,
				height : 400,
				title : "关联网段",
				modal : true,
				resizable : true,
				maximizable : true,
				iconCls : 'server',
				items : [grid],
				plain : true
				
			});
	WeekTimeWindows.addButton({
				text : "确定",
				handler : function() {
					
					WeekTimeWindows.close();
				}
			});
	WeekTimeWindows.addButton({
				text : '取 消',
				handler : function() {
					WeekTimeWindows.close();
				}
			});
	WeekTimeWindows.show();
}